package top.mccat.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import top.mccat.common.annotation.Excel;
import top.mccat.common.core.domain.BaseEntity;

/**
 * 【请填写功能名称】对象 employee_punch
 * 
 * @author ruoyi
 * @date 2022-03-30
 */
public class EmployeePunch extends BaseEntity
{
    public enum PunchStatus{
        /**
         * 0代表正常，1代表迟到，2代表早退，3代表旷工
         */
        Normal(0),
        ArriveLate(1),
        EarlyLeave(2),
        ArriveLateAndLeaveEarly(3)
        ;
        private int status;

        PunchStatus(int status) {
            this.status = status;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }
    }
    private static final long serialVersionUID = 1L;

    /** 打卡表主键 */
    private Long id;

    /** 用户id，对应sys_user表的user_id */
    @Excel(name = "用户id")
    private Long userId;

    /** 0代表未打卡，1代表已打卡 */
    @Excel(name = "打卡状态", readConverterExp = "0=正常,1=迟到,2=早退,3=迟到并早退")
    private Integer punchStatus;

    /** 开始打卡时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始打卡时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /** 下班打卡时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "下班打卡时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setPunchStatus(Integer punchStatus) 
    {
        this.punchStatus = punchStatus;
    }

    public Integer getPunchStatus() 
    {
        return punchStatus;
    }
    public void setStartTime(Date startTime) 
    {
        this.startTime = startTime;
    }

    public Date getStartTime() 
    {
        return startTime;
    }
    public void setEndTime(Date endTime) 
    {
        this.endTime = endTime;
    }

    public Date getEndTime() 
    {
        return endTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("punchStatus", getPunchStatus())
            .append("startTime", getStartTime())
            .append("endTime", getEndTime())
            .toString();
    }
}
